#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/12/28 21:10
# @Author  : micah
# @File    : 2.字节数据与字符串数据的互转问题.py
# @Software: PyCharm


byte_code = b'abc'
print(byte_code)
str_code = byte_code.decode()  # 将字节转为字符串
print(str_code)

byte_code_2 = str_code.encode('utf-8')  # windows在进行编码时最好手动指定utf-8
print(byte_code_2)


